package com.song.dubboprovider.serviceImpl;

import com.song.dubboapi.service.TestService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Component;

import java.util.Optional;

/**
 * @author Song Yinghui
 * @date 2018/8/30
 * @Version 1.0
 */
@DubboService
@Component
public class TestServiceImpl implements TestService {

    @Override
    public String sayHello(String name) {
        return "1212";
    }

    @Override
    public String test() {
        return null;
    }


    @Override
    public String getServerinfo(String client) {
        Object o = System.getProperties().get("server.name");
        return Optional.ofNullable(o).map(Object::toString).orElse("params is null ");
    }
}
